package com.twu.solo;

import java.io.PrintStream;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: thoughtworker
 * Date: 10/10/13
 * Time: 1:19 PM
 * To change this template use File | Settings | File Templates.
 */
public class Team {
    public List<Player> playerList;
    public String teamName;
    public PrintStream printStream;
    public List<Coach> coaches;

    public Team(String teamName, PrintStream printStream, List<Player> playerList, List<Coach> coaches) {
        this.teamName = teamName;
        this.printStream = printStream;
        this.playerList = playerList;
        this.coaches = coaches;
    }


    public void printPlayers() {
        printStream.println(stringOfPlayers());
    }

    public String stringOfPlayers() {
        String playerListString = "";
        for(Player player: playerList) {
            playerListString += player.getInfo();
        }
        return playerListString;
    }

    public String stringOfCoaches(){
        String coachListString = "";
        for (Coach coach : coaches) {
            coachListString += coach.getInfo();
        }
        return coachListString;
    }

    public void printTeam() {
        printStream.println(stringOfPlayers() + stringOfCoaches());
    }
}
